/**
 * 
 */
package com.gcgt.server.trader;

import java.util.Date;
import java.util.Iterator;

/**
 * @author Vincentas
 *
 */
public class LineMarket extends Market {

	private final Iterator<MarketUpdate> updates;
	
	public LineMarket(Iterator<MarketUpdate> updates) {
		this.updates = updates;
	}	

	public void roll(Date startDate, Date endDate) {
		while (updates.hasNext()) {
			MarketUpdate update = updates.next();
			if (update.getDate().before(endDate) && update.getDate().after(startDate)) {
				notifyTraders(update);
			}
		}
	}
}
